public class project {
    public int[] missingRolls(int[] rolls, int mean, int n) {
        int m=rolls.length;
        int sum=mean*(m+n);
        for(int roll:rolls){
            sum-=roll;
        }
        if(sum<n||sum>6*n){
            return new int[0];
        }
        int mid=sum/n;
        int ans=sum%n;
        int[] ret=new int[n];
        for(int i=0;i<n;i++){
            ret[i]=mid+(i<ans?1:0);
        }
        return ret;
    }
}
